package com.dustedpixels.jasmin.video;

import java.nio.ByteBuffer;

public interface RenderingContext {
    /**
     * Sets the frame size.
     */
    void setSize(int width, int height);

    /**
     * Sets the palette as buffer with RGBA values. The max palette size is 256
     * colors, which is 1024 bytes.
     * 
     * @param rgbaBuffer The RGBA buffer.
     */
    void setPaletteRGBA(ByteBuffer rgbaBuffer);

    /**
     * Renders the frame using palette. There must be at least w*h bytes
     * available in the buffer.
     * 
     * @param colors The color indices.
     */
    void renderPalette(ByteBuffer colors);

    /**
     * Renders the frame with RGBA values. There must be at least 4*w*h bytes
     * available in the buffer.
     * 
     * @param rgbaBuffer The RGBA buffer.
     */
    void renderRGBA(ByteBuffer rgbaBuffer);
}
